﻿using FlyIL;
using FlyRemote.Base;
using FlyRemote.Remote;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TestEmu;

namespace TestFw
{
    internal class Program
    {

        /// <summary>
        ///   对应 ry 12-1 版本 
        /// </summary>
        static readonly string _process = "RY";
        //static readonly string _process = "Test4vmp";

        static void _init()
        {



            var wp = PAFactory.Default;


            var list = wp.GetProcesses();
            foreach (var u in list)
            {
                if (u.ProcessName.Equals(_process, comparisonType: StringComparison.CurrentCultureIgnoreCase))
                {
                    wp.OpenedProcess = u;
                    break;
                }
            }


            //var mod = def.GetModules();

            //var addr = def.ResolveModule(_process);


        }


        static void Main(string[] args)
        {


            UnicornWrapper wrapper = new UnicornWrapper(false, new byte[] { 0x41, 0x41, 0x41, 0x41, 0x41 });
            wrapper.Run(0x40000, 0x40004);
            uint eax = wrapper.ECX;



            _init();

            Snapshot sp = SnapshotMaker.Create(DataType.Empty, SnapshotRetrievalMode.FromExe);

            IReader reader = new MyReader(sp.ReadGroups[0]);

            CheckCollect collect = new CheckCollect(false , sp.ReadGroups[0] , reader );


            collect.Collect( 0x04232145,  0 );

        }
    }
}
